﻿using System;
using System.Web.UI;

namespace WeiSha.Core
{
	// Token: 0x02000009 RID: 9
	public static class PageHelper
	{
		// Token: 0x06000041 RID: 65 RVA: 0x000035F8 File Offset: 0x000017F8
		public static void Alert(this Page page, string say)
		{
			bool flag = string.IsNullOrWhiteSpace(say);
			if (!flag)
			{
				bool flag2 = page == null;
				if (!flag2)
				{
					say = say.Replace("\\", "\\\\");
					say = say.Replace("\r", "");
					say = say.Replace("\n", "");
					string text = "<script language='JavaScript' type='text/javascript'>alert('{say}');</script>";
					text = text.Replace("{say}", say);
					bool flag3 = page == null;
					if (!flag3)
					{
						bool flag4 = !page.ClientScript.IsStartupScriptRegistered(page.GetType(), "alert");
						if (flag4)
						{
							page.ClientScript.RegisterStartupScript(page.GetType(), "alert", text);
						}
					}
				}
			}
		}
	}
}
